package com.ambimmort.shj.service.generalfile;

import cn.net.greenet.generalfile.logic.GeneralFileProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.PrintWriter;

/**
 * Created by 师梁 on 2015/7/30.
 */


@Service("del_AllService")
public class Del_AllService {

    public boolean del( String type){

        GeneralFileProcess pro = new GeneralFileProcess();
        boolean flag = false;
        pro.init();
        String sql = null;
        if (type.equals("1")) {
            sql = GeneralFileProcess.DEL_PRO_L;
        }
        if (type.equals("2")) {
            sql = GeneralFileProcess.DEL_WEB;
        }
        if (type.equals("3")) {
            sql = GeneralFileProcess.DEL_APP;
        }
        if (type.equals("4")) {
            sql = GeneralFileProcess.DEL_HTTP_DB;
        }
        if (type.equals("5")) {
            sql = GeneralFileProcess.DEL_HTTP_DW;
        }
        if (type.equals("6")) {
            sql = GeneralFileProcess.DEL_HTTP_UB;
        }
        if (type.equals("7")) {
            sql = GeneralFileProcess.DEL_IP_BANK;
        }
        if (sql != null) {
            flag = pro.delete(sql);
        }
        pro.close();

        try {
        } finally {
           return !flag;
        }
    }
}
